
SimpleObjectCreater = class(ObjectCreater)

function SimpleObjectCreater:init(id,name,tex,icon)
    ObjectCreater.init(self,id,name,tex,icon)
    self.body = nil
    self.renderXOffset = 0
    self.renderYOffset = 0
    self.parameter = {}
    self.objectType = ObjectCreater.Type.SimpleObject
end

-- 此方法设置了创建时的参数
function SimpleObjectCreater:setParameter(arg)
    self.parameter = arg
    return self
end

-- 设置渲染时的位置偏移
function SimpleObjectCreater:setRenderOffset(x,y)
    self.renderXOffset = x
    self.renderYOffset = y
end

function SimpleObjectCreater:createBody(x,y,angle,...)
    local body = self:createFunction(x,y,...)
    self:startCreating(body)
    body.x = x
    body.y = y
    body.angle = angle or 0
    body.id = self.id
    body.tex = self.tex
    body.draw = self.draw
    body.interpolate = true
    
    body.renderXOffset = self.renderXOffset
    body.renderYOffset = self.renderYOffset
    
    for k,v in pairs(self.parameter) do
        body[k] = v
    end
    
    return body
end

-- 此方法需要重写
function SimpleObjectCreater:createFunction(...)
    
end

-- 此方法的self指一个body实例
function SimpleObjectCreater:draw()
    
end

function SimpleObjectCreater:touched(touch)
    
end
